package tools;

import java.sql.*;
import oracle.jdbc.driver.OracleDriver;

public class KoneksiDataBase {

    private static String jdbcURL = "jdbc:Oracle:thin:@172.23.9.185:1521:orcl";
    private static String user = "MHS105314089";
    private static String password = "MHS105314089";
    private static Connection connection;
//    private static String jdbcURL = "jdbc:Oracle:thin:@localhost:1521:XE";
//    private static String user = "system";
//    private static String password = "hr";
//    private static Connection connection;

    public static Connection KoneksiDataBase() throws SQLException {

        if (connection == null) {
            DriverManager.registerDriver(new OracleDriver());
            connection = DriverManager.getConnection(jdbcURL, user, password);
            System.out.println("koneksi berhasil");
        }
        return connection;
    }
}
